<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/white/common/common.jsp"%>
<%@include file="/white/common/taglibs.jsp"%>
<html>
<head>
<script type="text/javascript" language="javascript"
	src="<%=request.getContextPath()%>/white/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">


$(function(){
	//渠道 - 请求类型级联操作
    $("#query_channel").on({
    	change:function(){
        	var requestType = $("#query_requestType"); //请求类型
        	if(this.value != ""){
        		$.ajax({
        			url:"nspAbilityRequestDayAction!queryRequest.action",
        			dataType:"json",
        			type:"post",
        			error: function(XMLHttpRequest, textStatus, errorThrown) {
        				//alert(XMLHttpRequest.status + "|" +textStatus);
        			},
        			success:function(responseText) {
        				requestType.empty(); //清空请求类型下拉框信息
        				if(responseText.length == 0){
        					alert("数据有误");
        				}else{
        					$.each(responseText,function(i,list){
        						if(this.val() == list[0]){
        							requestType.append("<option value='"+list[1]+"' >"+list[1]+"</option>");
        						}
        					});
        					if($.trim(requestType[0].value)==""){
        						requestType.append("<option value=''>-无对应请求类型-</option>");
        					}
        				}
        			}
        		});
        	}else{
        		requestType.empty();
        		requestType.append("<option value=''>-全部-</option>");
        	}
        },
        onbulr:function(){
        	window.open("<%=request.getContextPath()%>/nspAbilityRequestDayAction!queryChannel.action?",null,"width=800,height=500,scrollbars=yes,resizable=yes," +
            "status=no,top=152,left=225");
        }
    });
	
	$("input[name='channelCode']").dblclick(function(){
		window.open("<%=request.getContextPath()%>/nspAbilityRequestDayAction!queryChannel.action?flag=0",null,
				"width=300,height=500,toolbar=no,scrollbars=yes,resizable=no,status=no,location=no,top=152,left=225");
	});
	
	$("input[name='query_requestType']").dblclick(function(){
		window.open("<%=request.getContextPath()%>/nspAbilityRequestDayAction!queryChannel.action?flag=1",null,
				"width=300,height=500,toolbar=no,scrollbars=yes,resizable=no,status=no,location=no,top=152,left=225");
	});
	
	$("#regionName").dblclick(function(){
		window.open("<%=request.getContextPath()%>/nspAbilityRequestDayAction!queryChannel.action?flag=2",null,
				"width=300,height=500,toolbar=no,scrollbars=yes,resizable=no,status=no,location=no,top=152,left=225");
	});
});
<!--
	function submitForm() {
		var searchForm = document.getElementById("searchForm");
		searchForm.submit();
	}

	function notAllowedLockSelf(id) {
		var searchForm = document.getElementById("searchForm");
		searchForm.action = "userAction-" + id + "!lock.action";
		searchForm.submit();
	}

	function validateModify() {
		var check = document.getElementsByName("selectedIds");
		var a = 0;
		var id;

		for (var i = 0; i < check.length; i++) {
			if (check[i].checked == true) {
				a++;
				id = check[i].value;
			}
		}

		if (a == 1) {
			var searchForm = document.getElementById("searchForm");
			searchForm.action = "nspFatallogImeiMonthregionSumAction-" + id
					+ "!toEdit.action";
			searchForm.submit();
			return true;
		} else {
			alert("请�?择一条记�?");
			return false;
		}
	}

	function validateDelete() {
		var check = document.getElementsByName("selectedIds");
		var a = false;
		for (var i = 0; i < check.length; i++) {
			if (check[i].checked == true) {
				a = true;
				break;
			}
		}
		if (a) {
			return confirm('你确定所�?');
		} else {
			alert("请先择你要删除的内容!!");
			return false;
		}
	}

	function doDelete() {
		var searchForm = document.getElementById("searchForm");
		searchForm.action = 'nspFatallogImeiMonthregionSumAction!delete.action';
		searchForm.submit();
		return true;
	}

	function displayResult() {
		var result = "<s:property value='result'/>";
		if (result != null && result != "") {
			alert(result);
		}
	}
//-->
</script>
</head>
<body onload="displayResult()">
	<s:form method="post"
		action="nspFatallogImeiMonthregionSumAction!queryByPage.action"
		theme="simple" id="searchForm">
		<div id="div_title">
			<h3>
				<%-- ${classDisplayName}浏览: NSP_FATALLOG_IMEI_MONTHREGION_SUM --%>
				${classDisplayName}浏览: 能力调用分省月统计
			</h3>
			<div id="div_search">
				<table>

					<tr>
						<td width="40" align="right">日期:</td>
						<td><s:textfield name="query_logDate" label="日期" size="8"
								maxlength="10"
								onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyyMM', minDate:'1900-01-01',maxDate:''})"></s:textfield>
							- <s:textfield name="query_logDate_end" label="日期" size="8"
								maxlength="10"
								onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyyMM', minDate:'1900-01-01',maxDate:''})"></s:textfield>
						</td>

						<%-- <td width="60" align="right">请求类型:</td>
						<td><s:select list="requestTypeMap" headerKey=""
								headerValue="-全部-" name="query_requestType"
								id="query_requestType" value="query_requestType">
							</s:select></td>
						<td width="80" align="right">地区名称:</td>
						<td><s:textfield name="query_regionCode" /></td> --%>
						<td width="60" align="right">
								渠道:
							</td>
							<td>
								<s:textfield name="channelCode" id="channelCode"/>
								<%--<s:select list="channelMap" headerKey="" headerValue="-全部-"
									name="query_channel" id="query_channel" value="query_channel">
								</s:select>
								--%><%--<select id="query_channel" name="query_channel" multiple="multiple">
									<option value="">-全部-</option>
									<s:iterator value="channelMap.keySet()" var="info" id="key">
										<option value="<s:property value="channelMap[#key]"/>">
											<s:property value="channelMap.get(#key)" />
										</option>
									</s:iterator>
								</select>--%>
							</td>
							<td width="60" align="right">
								请求类型:
							</td>
							<td>
							<s:textfield name="query_requestType" id="query_requestType"/>
							</td>
							<td width="60" align="right">
								地区名称:
							</td>
							<td>
							<s:textfield name="regionName" id="regionName"/>
							</td>
						<td width="80" align="right"><authz:authorize
								ifAnyGranted="SMOOTH_ALL">
								<s:submit cssClass="submit_search" value="搜索"
									action="nspFatallogImeiMonthregionSumAction!queryByPage" />
							</authz:authorize></td>
					</tr>
				</table>
			</div>
		</div>
		<%-- <div id="div_button">
				<authz:authorize ifAnyGranted="SMOOTH_ALL">
					<s:submit value="新增"
						onclick="form.action='nspFatallogImeiMonthregionSumAction!toAdd.action';return true;"
						cssClass="input_button" />
				</authz:authorize>
				<authz:authorize ifAnyGranted="SMOOTH_ALL">
					<s:submit value="修改" onclick="return validateModify()"
						cssClass="input_button" />
				</authz:authorize>
				<authz:authorize ifAnyGranted="SMOOTH_ALL">
					<input type="button" value="删除"
						onclick="if(validateDelete()){doDelete()}" class="input_button">
				</authz:authorize>
				<%@include file="/white/common/message.jsp"%>
			</div> --%>
		<!--列表 �?�� -->
		<table cellpadding="0" cellspacing="0" class="t_list">
			<tr>
				<th colspan="5" style="BORDER: #DC2913 1px solid;"></th>
				<th colspan="3" style="BORDER: #DC2913 1px solid;">终端数</th>
				<th colspan="3" style="BORDER: #DC2913 1px solid;">当月请求数</th>
			</tr>
			<tr>
				<!--列表头部 -->

				<th style="BORDER: #DC2913 1px solid;">月份</th>
				<th style="BORDER: #DC2913 1px solid;">地区代码</th>
				<th style="BORDER: #DC2913 1px solid;">地区名称</th>
				<th style="BORDER: #DC2913 1px solid;">渠道类型</th>
				<th style="BORDER: #DC2913 1px solid;">请求类型</th>

				<th style="BORDER: #DC2913 1px solid;">当月数</th>
				<th style="BORDER: #DC2913 1px solid;">累计</th>
				<th style="BORDER: #DC2913 1px solid;">月增量</th>
				<th style="border-right: #DC2913 1px solid;">总数</th>
				<th style="border-right: #DC2913 1px solid;">有IMEI</th>
				<th style="border-right: #DC2913 1px solid;">无IMEI</th>
			</tr>
			<s:iterator value="resultList" status="sindex">
				<tr>
					<%-- <td><input type="checkbox" name="selectedIds" value="${ FATALLOG_IMEI_MONTHREGION_SUM_ID }" id="selectedIds" /></td>	 --%>

					<td style="BORDER: #DC2913 1px solid;"><s:property
							value="LOG_MONTH" /></td>
					<td style="BORDER: #DC2913 1px solid;"><s:property
							value="REGION_CODE" /></td>
					<td style="BORDER: #DC2913 1px solid;"><s:property
							value="REGION_NAME" /></td>
					<td style="BORDER: #DC2913 1px solid;"><s:if
							test='CHANNEL_NAME == null'>-</s:if> <s:else>
							<s:property value="CHANNEL_NAME" />
						</s:else></td>
					<td style="BORDER: #DC2913 1px solid;"><s:if
							test='REQUEST_TYPE == null'>-</s:if> <s:else>
							<s:property value="REQUEST_TYPE" />
						</s:else></td>
					<td style="BORDER: #DC2913 1px solid;"><s:property
							value="IMEI_MONTH_COUNT" /></td>
					<td style="BORDER: #DC2913 1px solid;"><s:property
							value="IMEI_ALL_COUNT" /></td>
					<td style="BORDER: #DC2913 1px solid;"><s:property
							value="IMEI_ALL_COUNT-IMEI_NEW_COUNT" /></td>
					<td style="BORDER: #DC2913 1px solid;"><s:if
							test='REQUEST_COUNT == null'>0</s:if> <s:else>
							<s:property value="REQUEST_COUNT" />
						</s:else></td>
					<td style="BORDER: #DC2913 1px solid;"><s:if
							test='REQUEST_IMEI_COUNT == null'>0</s:if> <s:else>
							<s:property value="REQUEST_IMEI_COUNT" />
						</s:else></td>
					<td style="BORDER: #DC2913 1px solid;"><s:if
							test='REQUEST_NOIMEI_COUNT == null'>0</s:if> <s:else>
							<s:property value="REQUEST_NOIMEI_COUNT" />
						</s:else></td>
				</tr>
			</s:iterator>
		</table>
		<!--列表 结束 -->
		<!--分页 �?�� -->
		<s:if test="resultList.size() > 0">
			<table border="0" cellspacing="0" cellpadding="0" class="t_bottom">
				<tr>
					<td><%@include file="/white/common/pageList.jsp"%></td>
				</tr>
			</table>
		</s:if>
		<!--分页 结束 -->

	</s:form>
</body>
</html>
